package com.example.controller;

import com.example.entity.Mycoupon;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.stereotype.Controller;





@Controller
public class DemoController
{
    @RequestMapping("/")
    public String index()
    {
        return"index";
    }





    @RequestMapping(value="/save", method=RequestMethod.POST)
    public ModelAndView save(@ModelAttribute Mycoupon coupon)
    {

        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("coupon-data");
        modelAndView.addObject("Mycoupon", coupon);
        return modelAndView;


    }









}